import request from '@/utils/request'

// 查询Bonus列表
export function listAccount(query) {
  return request({
    url: '/bonus/account/list',
    method: 'get',
    params: query
  })
}

// 查询Bonus详细
export function getAccount(id) {
  return request({
    url: '/bonus/account/' + id,
    method: 'get'
  })
}

// 新增Bonus
export function addAccount(data) {
  return request({
    url: '/bonus/account',
    method: 'post',
    data: data
  })
}

// 修改Bonus
export function updateAccount(data) {
  return request({
    url: '/bonus/account',
    method: 'put',
    data: data
  })
}
// Add Bonus
export function addAccountBalance(data) {
  return request({
    url: '/bonus/account/incBalance',
    method: 'post',
    data: data
  })
}

// 删除Bonus
export function delAccount(id) {
  return request({
    url: '/bonus/account/' + id,
    method: 'delete'
  })
}

// 导出Bonus
export function exportAccount(query) {
  return request({
    url: '/bonus/account/export',
    method: 'get',
    params: query
  })
}

// 获取账号余额
export function getUserAccount(query) {
  return request({
    url: '/bonus/account/mine',
    method: 'get',
    params: {}
  })
}